UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xl/vuKkZ0cx0klYjxzflDO73YXT8Qj8MmXBzcV2HCwM='
WHERE
key_id = '2ba7b3a5a0dc17a106f03e04f8d01d1bab160147f1e447b671ce19b02660e4db'
AND (
token = 'xl/vuKkZ0cx0klYjxzflDO73YXT8Qj8MmXBzcV2HCwM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)