UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5rRBJbuUVOYsymWH0ktoKgsQ7K5nA7tVMwyjDvb4TNg='
WHERE
key_id = 'a11b1d932cfad5676eca376e9dc08842eef74cdd0817ad65096a426c625f2268'
AND (
token = '5rRBJbuUVOYsymWH0ktoKgsQ7K5nA7tVMwyjDvb4TNg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)