UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '36y1uShZR9uZpT780SxmfEwaZRqQPiS8+tCItAxeZWg='
WHERE
key_id = 'f75c04539d93bccc434e766edc4c86c7b33775a15b6a57e8902bb07d6c75ec5f'
AND (
token = '36y1uShZR9uZpT780SxmfEwaZRqQPiS8+tCItAxeZWg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)