UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DcD2gU5iFH6w+QpKZFmRQZdUgLU4RL3RGr0ifhaEb4M='
WHERE
key_id = 'c011af679d00f0b9f027c763427e8b71cb0ba5a5826eabffcbd5f4be399cc17a'
AND (
token = 'DcD2gU5iFH6w+QpKZFmRQZdUgLU4RL3RGr0ifhaEb4M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)