UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9MhgubntY19G5ytMev56NaSnsVZpCBRORbadhEbCu94='
WHERE
key_id = '05d955ee61e7cfcdfb83bd528e356be7d1ed69ab4163b766eaa5c76ce4f3c10d'
AND (
token = '9MhgubntY19G5ytMev56NaSnsVZpCBRORbadhEbCu94='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)