UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xL0Xhd/XBl+MaFL3aEWZsxh9Z5KdCA3N4vIsjdIJb5M='
WHERE
key_id = 'ce3f85e221be1ae1434217d5036d8973be4f8c26fdea1e53232794bcf3dd0d97'
AND (
token = 'xL0Xhd/XBl+MaFL3aEWZsxh9Z5KdCA3N4vIsjdIJb5M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)