UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y1C8Re8lhRp0YRoOUsq2pNhpjEsVaki9rlNXcfMwr1s='
WHERE
key_id = '76696a02e79802231b37ac1faa5ceab08b6214ba7923598ed58565dbc06c7ab1'
AND (
token = 'y1C8Re8lhRp0YRoOUsq2pNhpjEsVaki9rlNXcfMwr1s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)