UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6Gj6kAmrsAwYSz/T8gemuVllg7ENvt4mT9n7EVO/16o=' 
WHERE 
  key_id = '90de667a590a3e97424439bfa9e25749ab37291a795db79a5381b16162cd506c' 
  AND (
    token = '6Gj6kAmrsAwYSz/T8gemuVllg7ENvt4mT9n7EVO/16o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039