UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2fgt3l7bcVa/sJsxtlkwQVPb4Y+y/7Ngezf6ACQb30g='
WHERE
key_id = 'd745b2a9e5090384794b508a5e547017b34225223289c47ca355c0ccb0f4ff3b'
AND (
token = '2fgt3l7bcVa/sJsxtlkwQVPb4Y+y/7Ngezf6ACQb30g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)