UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5Q5ChBDzPTlAk8fZzbj+ZBq8Hl5zkKlJ62Yd6HSNOZA='
WHERE
key_id = '86767f77533a7fb9462e4245c8ed103bafb571a4246cadf09663db5873e778de'
AND (
token = '5Q5ChBDzPTlAk8fZzbj+ZBq8Hl5zkKlJ62Yd6HSNOZA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)