UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YDNlUedJ6bBhCQxnAT9O/SqyMDMohZ/543jGE+KhEzg='
WHERE
key_id = '97b234aee1e113531ba6a8e4c4f22008f4ff4a1d8c3b3b9f1fa268bdc5282ff3'
AND (
token = 'YDNlUedJ6bBhCQxnAT9O/SqyMDMohZ/543jGE+KhEzg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)