UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+FbRSENQf3CcTDdZBILaRwaNoESfFKzaPbcnA+8ejQk='
WHERE
key_id = 'ae20464571643a081a8d9e9dd943fd5552dd164f73a1a9ea08c4658d94d5324b'
AND (
token = '+FbRSENQf3CcTDdZBILaRwaNoESfFKzaPbcnA+8ejQk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)