UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '13m4IFpxtMOTgd1nnLDH8vi/UNTnsQLju/z9HxGMfX8='
WHERE
key_id = 'd2ecd925b830d8174c74cc1b989cbdfb788ca8bc4da972a5cca1c81c2894b9b0'
AND (
token = '13m4IFpxtMOTgd1nnLDH8vi/UNTnsQLju/z9HxGMfX8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)