UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zmo0QDZz8i31vzCDt7S0gFYcHkdn09LvpjA9bV/DZV0=' 
WHERE 
  key_id = '6a91f111f98776355bdbc7819b8bfdbdf0da106e0135b154a708b486bc029511' 
  AND (
    token = 'zmo0QDZz8i31vzCDt7S0gFYcHkdn09LvpjA9bV/DZV0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030