UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6YwOqaNprJUdIIpMr5ROS+JgRu6rCnbrdFSfQid8Q60='
WHERE
key_id = 'e27402ef9a93eecca4654ca1fe1bcf6155fd3cf963b7e1e49168218ae4936526'
AND (
token = '6YwOqaNprJUdIIpMr5ROS+JgRu6rCnbrdFSfQid8Q60='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)