UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pVEtq97P2xcmuEE6Lfk/xiqdrjnjCTAfIx5Ns18BtuU=' 
WHERE 
  key_id = 'd9dfb19619574c84a8d588cfd894b5ccedaadc40de662f469aca8207af3d4608' 
  AND (
    token = 'pVEtq97P2xcmuEE6Lfk/xiqdrjnjCTAfIx5Ns18BtuU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041