UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5epedQfg/DTkdqfZFIcRNrkL8o8na2yxbWrJbHG1sb0='
WHERE
key_id = '23ed48653b1f8ad100da777cf1e00d99365e15f0285e309c8f2acc95d3ffd420'
AND (
token = '5epedQfg/DTkdqfZFIcRNrkL8o8na2yxbWrJbHG1sb0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)