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