UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tVD/GqwQsTS5HmojhzLKgd1WMHvKhks99kvst+sq3vM='
WHERE
key_id = '4a2dcb02badd54c3fdd07782760a0e53b525733ad6e47a94ac46d4e81b16933e'
AND (
token = 'tVD/GqwQsTS5HmojhzLKgd1WMHvKhks99kvst+sq3vM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)