UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NnbrHGPErgWrqRb/Dod1IQqRQWefvGWxs/n8XQcesjI=' 
WHERE 
  key_id = '6f3ceadcca4fd942bee3942bfa42ef5d4e1e30a506fb05bbaa914a6f853a2a7e' 
  AND (
    token = 'NnbrHGPErgWrqRb/Dod1IQqRQWefvGWxs/n8XQcesjI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054