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