UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UDAIln9Kf/U8irX9N/lNp2IhgKcLJWffLxwZFQpMQEs='
WHERE
key_id = '7119fe2a23a8f09d8f601a7d46b021a08e9660b78bf337ef2e9a43133bb5f7ae'
AND (
token = 'UDAIln9Kf/U8irX9N/lNp2IhgKcLJWffLxwZFQpMQEs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)