UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PlJjkTSzX1msKf+epIpvx8xuqEnBT0qS9fhvs6PUBug='
WHERE
key_id = '836f0b960a5c08c6202dccaae16424a5e7cbe76f2b5c0af96cdb382d9108043c'
AND (
token = 'PlJjkTSzX1msKf+epIpvx8xuqEnBT0qS9fhvs6PUBug='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)