UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZzAx7lKc6pIC7To7BZJQUuoK5aKYcEGPTE62itGCCHs='
WHERE
key_id = '98abe0dab0f092e4070ea46ce6dbf76c0b6e58d4d47cbb4f4d8de514d3a74fa5'
AND (
token = 'ZzAx7lKc6pIC7To7BZJQUuoK5aKYcEGPTE62itGCCHs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)