UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G/bHv2LyWccwjuBBunf1rTdDTK1Q4pncNbDNZ88iBes='
WHERE
key_id = 'ce1b1adca4c2a1c9a30715bee91c37bd0feb55a1edd1f4fbc4bc3e2f437b29cd'
AND (
token = 'G/bHv2LyWccwjuBBunf1rTdDTK1Q4pncNbDNZ88iBes='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)