UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'N+m8S6OZM27Z4Z+zNdexGNYUQK34KAxo26gQ427NwZ4='
WHERE
key_id = '50ef26f7e3e3af5213668bd1c50cd3de91eecb9e373954b1bd86017ed910a3ba'
AND (
token = 'N+m8S6OZM27Z4Z+zNdexGNYUQK34KAxo26gQ427NwZ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)