UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '03G3Vs2OYIOMvsm72XV1A1dS5nR1sCT0/7vpKRz737E=' 
WHERE 
  key_id = '50cf87e694ca0ed27b0843888c6eb51b41e7e3eeea6c65d11e269b6896e42d51' 
  AND (
    token = '03G3Vs2OYIOMvsm72XV1A1dS5nR1sCT0/7vpKRz737E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047