UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZvvDgeMGHrwBvxXTuCDpkXGqCRClHsZo62e2ZJ1158o=' 
WHERE 
  key_id = 'b1cfcbe7dad0aff515847af4d37b54165a0b46e84cb23b09af86d9208a78d53c' 
  AND (
    token = 'ZvvDgeMGHrwBvxXTuCDpkXGqCRClHsZo62e2ZJ1158o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031