UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aEJTLOOETEz+tWLdToTiXj+u7rr+p6MLjaGd77ySbs4='
WHERE
key_id = '5826757ceb0ced42830d2acd5846044e0092be486497fda9ece38f40425202eb'
AND (
token = 'aEJTLOOETEz+tWLdToTiXj+u7rr+p6MLjaGd77ySbs4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)