UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lap2y/fjyWLX2/hbpm+biPwmI0s6pEzWPOZQ/Ioj79c='
WHERE
key_id = '05823145d49606b07cbf6265d380409843b1bae5364a08857fbc1aa2a9ed4baf'
AND (
token = 'lap2y/fjyWLX2/hbpm+biPwmI0s6pEzWPOZQ/Ioj79c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)