UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vrci6j/GZiccOQFmbnTuFpfnjRn4DEcy2elBNxvxCP8=' 
WHERE 
  key_id = '5942e35e5dc3fa91b47ae346913ccc75accc6e95625d9dff7be7b7f6f6067246' 
  AND (
    token = 'vrci6j/GZiccOQFmbnTuFpfnjRn4DEcy2elBNxvxCP8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035