UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Cmn1VjkVF1a+e9ZaMfMbqVEOZlJ3vgaQhUhWOJMvhWg=' 
WHERE 
  key_id = '67dfaed02a9270220c63a92642c68c0fc78f2a93d2bf1bc35758d30c59dd6281' 
  AND (
    token = 'Cmn1VjkVF1a+e9ZaMfMbqVEOZlJ3vgaQhUhWOJMvhWg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033